<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var obj = {
        name: "Marlen",
        age: "20",
        hobby: "basketball",
        eat: function () {
            document.write("姓名：" + obj.name + "<br></br>年龄:" + obj.age + "<br></br>爱好:" + obj.hobby)
        }
    }
    obj.eat()
</script>

</html>